package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.model.account.AccountDeductVo;
import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.model.account.UserAccountDetail;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {


    void register(Long userId);

    BigDecimal getAvailableAmount(Long userId);

    Boolean checkAndDeduct(AccountDeductVo accountDeductVo);

    void addUserAccountDetail(Long userId, String content, String typeMinus, BigDecimal amount, String orderNo);

    IPage<UserAccountDetail> findUserConsumePage(Page<UserAccountDetail> detailPage, Long userId);

    IPage<UserAccountDetail> findUserRechargePage(Page<UserAccountDetail> detailPage, Long userId);
}
